﻿<%@ Page Language="C#" CodeBehind="Colective.aspx.cs"  MasterPageFile="~/Administration/Administration.Master" AutoEventWireup="true" Inherits="IEWebSite.Administration.Colective" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <h1>Colective</h1>
        <asp:Label ID="lblError" runat="server" ForeColor="#FF9900"></asp:Label>
        <table style="border-width:0; margin-left:50px;">
            <tr>
                <td>
                    &nbsp; Colectiv:
                </td>
                <td>
                    <asp:TextBox ID="txtColectiv" runat="server" Width="450px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="ColectivBtnAdd" runat="server" Text="Adauga" 
                        onclick="ColectivBtnAdd_Click" BackColor="#990000" Font-Bold="True" 
                        ForeColor="White" />
                </td>
            </tr>
        </table>
        <h1>
            Stergere/Editare colective</h1>
        <div style="margin-left: 50px;">
            <asp:GridView ID="colectivGvName" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" CellPadding="4" DataSourceID="sqlGetColectiv" ForeColor="#333333"
                GridLines="None" PageSize="5" DataKeyNames="IdSysColectiv">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                    <asp:BoundField DataField="IdSysColectiv" HeaderText="ID" ReadOnly="True" 
                        SortExpression="IdSysColectiv" InsertVisible="False" Visible="True"/>
                    <asp:BoundField DataField="SysNumeColectiv" HeaderText="Colectiv" SortExpression="SysNumeColectiv" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:SqlDataSource ID="sqlGetColectiv" runat="server" ConnectionString="<%$ ConnectionStrings:SiteIEConnectionString %>"
                SelectCommand="SELECT SysColectiv.IdSysColectiv, SysColectiv.SysNumeColectiv FROM SysColectiv"
                DeleteCommand="DELETE FROM SysColectiv WHERE (IdSysColectiv = @IdSysColectiv)" 
                InsertCommand="INSERT INTO [SysColectiv] ([SysNumeColectiv]) VALUES (@SysNumeColectiv)"
                UpdateCommand="UPDATE SysColectiv SET SysNumeColectiv = @SysNumeColectiv WHERE (IdSysColectiv = @IdSysColectiv)">
                <DeleteParameters>
                    <asp:Parameter Name="IdSysColectiv" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="SysNumeColectiv" Type="String" />
                    <asp:Parameter Name="IdSysColectiv" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="SysNumeColectiv" Type="String" />
                </InsertParameters>
            </asp:SqlDataSource>
      </div>
</asp:Content>